[]
dashboard.DashboardDesigner
• new DashboardDesigner()
▸ addVisual(visualName
, width?
, height?
, left?
, top?
): Promise
<string
>
添加可视化组件到仪表板设计器
名称 | 类型 | 描述 |
---|---|---|
visualName |
string |
可视化组件名称 以下是一些内置的可视化组件名称, "richEditor", "picture","container", "tabContainer", "spreadChart", "mergedChart", "embeddedDashboard", "embeddedReport", "treeSlicer", "dateRangeSlicer", "comboBoxSlicer", "labelSlicer", "relativeDateSlicer", "dataRangeSlicer", "column", "stackedColumn", "percentStackedColumn", "rangeColumn", "bar", "stackedBar", "percentStackedBar", "rangeBar", "line""area", "stackedArea", "percentStackedArea", "rangeArea", "pie", "donut", "rose", "radialStackedBar", "stackedBarInPolar", "sunburst", "barInPolar", "radar", "filledRadar", "scatter", "bubble", "treeMap", "combined", "funnel", "gauge", "indicator", "KPI", "pivotTable", "dataTable", "kpiMatrix", "map", "webContent", "floorPlan", "card", "candlestick", "KpiKanban", etc. 如果添加的组件是自定义可视化组件,则组件名称由其作者定义 |
width? |
number |
组件宽度 |
height? |
number |
组件高度 |
left? |
number |
组件横坐标 |
top? |
number |
组件纵坐标 |
Promise
<string
>
示例代码
designer.addVisual(
visualName: 'column',
width: 400,
height: 300,
left: 0,
top: 0
);
▸ addVisualByTemplateId(templateId
, left?
, top?
): Promise
<string
>
添加模版作为可视化组件到仪表板设计器
名称 | 类型 | 描述 |
---|---|---|
templateId |
string |
可视化组件模版的id |
left? |
number |
组件横坐标 |
top? |
number |
组件纵坐标 |
Promise
<string
>
示例代码
designer.addVisualByTemplateId(
templateId: '658f8e5c-81a2-4a0c-a016-84ba52368b29',
left: 0,
top: 0
);
▸ destroy(): void
释放仪表板设计器实例的资源
void
▸ hideDataBindingPanel(): void
隐藏仪表板设计器的数据绑定面板
void
▸ hideInspector(): void
隐藏仪表板设计器的属性面板
void
▸ initialize(initOption
): Promise
<void
>
初始化仪表板设计器
名称 | 类型 |
---|---|
initOption |
DashboardDesignerInitOption |
Promise
<void
>
示例代码
designer.initialize({
container: document.querySelector("#dashboard"),
defaults: {
datasetId
},
features: {
actionbarItems : ["focus","annotation","shareScenario"]
},
onLoaded: (docName) => {
document.title = docName;
}
});
▸ isDocumentDirty(): boolean
获取当前仪表板文档的编辑状态
boolean
▸ off(eventType
, eventHandler
): void
取消监听仪表板事件
名称 | 类型 |
---|---|
eventType |
DesignerEventType |
eventHandler |
(...args : any []) => void |
void
▸ on(eventType
, eventHandler
): void
用于监听仪表板事件
名称 | 类型 |
---|---|
eventType |
DesignerEventType |
eventHandler |
(...args : any []) => void |
void
▸ save(option?
): Promise
<boolean
>
保存当前仪表板文档
名称 | 类型 |
---|---|
option? |
DocumentSaveOption |
Promise
<boolean
>
示例代码
designer.save({
name: 'xxxxx',
categories: ['xx'],
comment: 'xxxx',
shouldPublish: true
});
▸ setDatasetId(datasetId
): void
指定当前可视化组件的数据集
名称 | 类型 | 描述 |
---|---|---|
datasetId |
string |
数据集 id. |
void
▸ showDataBindingPanel(): void
显示仪表板设计器的数据绑定面板
void
▸ showInspector(): void
显示仪表板设计器的属性面板
void
▸ togglePreview(option?
): void
切换仪表板设计器的视图模式
名称 | 类型 |
---|---|
option? |
DocumentSyncOption |
void